# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-duecredit
_pkgorig=duecredit
pkgver=0.9.3
pkgrel=1
pkgdesc="Automated collection and reporting of citations for used software/methods/datasets"
url="https://github.com/duecredit/duecredit"
arch="noarch"
license="BSD-2-Clause-Views"
depends="python3 py3-citeproc-py py3-importlib-metadata py3-requests"
makedepends="py3-gpep517 py3-setuptools python3-dev py3-wheel"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/d/duecredit/duecredit-$pkgver.tar.gz"
options="net" # Required for test_import_doi
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e996f62ee69732b321ca37e3979455bdc855bc2344f4ff3bf9d75d0c80725e898c0352355d664646193dce74e8c64797cbc5b90681c1237d500870a0440153bb  py3-duecredit-0.9.3.tar.gz
"
